﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Wozuji.Logic.Users;


public partial class forgotPass : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Wozuji.Logic.Users.Users ur = new Wozuji.Logic.Users.Users();
        if (Wozuji.Common.PageValidate.IsEmail(TextBox1.Text.ToString()))
        {
            //判断邮箱是否存在
            
            if (ur.mailExist(TextBox1.Text.ToString()))
            {
                //执行密码找回操作
                if (ur.getBackPassword(TextBox1.Text.ToString()))
                {
                    Label1.Text = "密码重置邮件已经成功发送！";
                }
                else
                {
                    Label1.Text = "密码重置失败！请联系管理员";
                }

            }
            else
            {
                Label1.Text = "此邮箱不存在，请检出你的输入！";
            }
        }
        else
        {
            Label1.Text = "输入的邮箱格式不正确！";
        }

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("/default.aspx");
    }
}
